package com.apache.database.model;

import java.util.HashMap;
import java.util.Map;

/**
 * description: 方法参数模型
 * 
 */
public class MethodParam {

	private Object vaule;//待操作对象

	private String key;//执行KEY

	private String cacheId = "";//要缓存的对象ID值

	private String infoId = "";//信息ID

	private Map<String, Object> params = new HashMap<String, Object>();//方法参数

	private String sqlStr = "";

	private boolean isDelete = false;//是否执行物理删除

	private boolean isResultCache = true;//是否使用结果集缓存

	/** 以下参数为分页查询时使用 */
	private int PageIndex = 1;//当前页
	private int pageSize = 20;//每页行数
	private long pageCount = 0;//总记录数
	private String orderby = "";//排序条件

	private String spanceName;//空间名（当启用ibatis是此参数不能为空）

	public MethodParam() {
	}

	public MethodParam(String key, String cacheId, String sqlStr, String spanceName) {
		this.cacheId = cacheId;
		this.key = key;
		this.spanceName = spanceName;
		this.sqlStr = sqlStr;
	}

	public Object getVaule() {
		return vaule;
	}

	public void setVaule(Object vaule) {
		this.vaule = vaule;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public boolean isDelete() {
		return isDelete;
	}

	public void setDelete(boolean isDelete) {
		this.isDelete = isDelete;
	}

	public String getCacheId() {
		return cacheId;
	}

	public void setCacheId(String cacheId) {
		this.cacheId = cacheId;
	}

	public Map<String, Object> getParams() {
		return params;
	}

	public Object getParamsByKey(String key) {
		return params.get(key);
	}

	public void setParams(Map<String, Object> params) {
		if (null != params)
			this.params = params;
	}

	public void setParams(String key, String value) {
		this.params.put(key, value);
	}

	public String getSqlStr() {
		return sqlStr;
	}

	public void setSqlStr(String sqlStr) {
		this.sqlStr = sqlStr;
	}

	public int getPageIndex() {
		return PageIndex;
	}

	public void setPageIndex(int pageIndex) {
		PageIndex = pageIndex;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public long getPageCount() {
		return pageCount;
	}

	public void setPageCount(long pageCount) {
		this.pageCount = pageCount;
	}

	public String getSpanceName() {
		return spanceName;
	}

	public void setSpanceName(String spanceName) {
		this.spanceName = spanceName;
	}

	public String getOrderby() {
		return orderby;
	}

	public void setOrderby(String orderby) {
		this.orderby = orderby;
	}

	public String getInfoId() {
		return infoId;
	}

	public void setInfoId(String infoId) {
		this.infoId = infoId;
	}

	/**
	 * 是否使用结果集缓存
	 */
	public boolean isResultCache() {
		return isResultCache;
	}

	public void setResultCache(boolean isResultCache) {
		this.isResultCache = isResultCache;
	}

}
